home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ADA Programming Guide
/
ADA Programming Guide.iso
/
adatutor
/
adawkbk
/
sol2-6.ada
< prev
next >
Wrap
Text File
|
1996-01-30
|
650b
|
30 lines
-- Problem 2.6
-- by Rick Conn
with Text_IO;
procedure Main is
type FARRAY is array (POSITIVE range <>) of FLOAT;
FA1 : FARRAY(1..5) := (2.2, 3.3, 4.4, 5.5, 7.2);
FA2 : constant FARRAY := (12.2, 10.2, 1.0, 5.2);
FA3 : constant FARRAY := (1.1, 2.2);
package Float_IO is new Text_IO.Float_IO (FLOAT);
procedure Display_FARRAY (Item : in FARRAY) is
begin
for I in Item'RANGE loop
Text_IO.Put (" ");
Float_IO.Put (Item(I), 2, 1, 0);
end loop;
Text_IO.New_Line;
end Display_FARRAY;
begin -- Main
Display_FARRAY (FA1);
Display_FARRAY (FA2);
Display_FARRAY (FA3);
end Main;